import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import {RenderType} from '@pkg/setting';
export const columns: BasicColumn[] = [
  {
    title: '版本名称',
    dataIndex: 'verName',
    width: 150,
  },
  {
    title: '版本号',
    dataIndex: 'verNo',
    width: 100,
  },
  {
    title: '强制更新',
    dataIndex: 'forceUpdate',
    width: 80,
    dictData: [
      { label: '是', value: 1, color: '#a6a9a6' },
      { label: '否', value: 0, color: '#09d550' }
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'verNo',
    label: '版本号',
    component: 'Input',
    colProps: { span: 4 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '版本名称',
    field: 'verName',
    component: 'Input',
    required: true,
  },
  {
    label: '版本号',
    field: 'verNo',
    component: 'Input',
    required: true,
  },
  {
    field: 'forceUpdate',
    label: '强制更新',
    component: 'ApiRadioGroup',
    required: true,
    componentProps: {
      options: [
        {label: '否', value: 0},
        {label: '是', value: 1},

      ],
    }
  },
  {
    label: '上传文件',
    field: 'verUrl',
    component: 'FileUpload',
    required: true,
  },
  {
    label: '更新内容',
    field: 'verContent',
    component: 'InputTextArea',
    required: true,
  },
];
